import { createRouter, createWebHashHistory } from 'vue-router'
import { useUserStore } from '@/store/useUserStore'
import routes from './routes'

const router = createRouter({
  history: createWebHashHistory(),
  routes,
})

router.beforeEach(async (to, form) => {
  const { userInfo } = useUserStore()
  console.log('to', to);
  console.log('from', form);
  // await useUserStore.getUserInfo()
  
  return true
})

export { router }
